<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../application/vue.js"></script>
</head>
<body>
    <div id="app">
        <p>{{msg}}</p>
        <p v-text="msg"></p>
        <p v-aaaa:bb.cc.dd="msg+'aaa'">自定义变量</p>
        <input type="text" v-model="msg">
        <hr>
        <p v-aaaa="'red'">自定义变量</p>
        <p v-aaaa="'pink'">自定义变量</p>
        <p v-aaaa="'blue'">自定义变量</p>
        <p v-aaaa="'yellow'">自定义变量</p>
        <p v-aaaa="'purple'">自定义变量</p>
    </div>
</body>
<script>
    Vue.directive("aaaa",function(el,binding){
        console.log("全局指令",el,binding);
        // el.style.color="red";
        el.style.color=binding.value;
    })
    var vm=new Vue({
        el:"#app",
        data:{
            msg:"初始变量"
        }
    })
</script>
</html>